package com.bdqn.qnnews.admin.controller;

import com.bdqn.qnnews.admin.service.AdUserService;
import com.bdqn.qnnews.admin.vo.AdLoginReqVo;
import com.bdqn.qnnews.admin.vo.AdUserRespVo;
import com.bdqn.qnnews.common.base.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xlz
 * @since 2023-12-25
 * @description 管理员登录控制器
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@Tag(name = "管理员用户登录控制器类")
public class AdUserLoginController {

    private final AdUserService adUserService;

    @Operation(summary = "平台管理员登录", description = "平台管理员登录")
    @PostMapping("/login/in")
    public R<AdUserRespVo> login(@RequestBody AdLoginReqVo vo) {
        final AdUserRespVo respVo = adUserService.login(vo);
        return R.ok(respVo);
    }
}
